import React from 'react';
import BurstModeOutlined from '@material-ui/icons/BurstModeOutlined';
import { SpcCfg } from './cfg/view';
import { SpcCheck } from './check';
import { loc,NavListSub, NavView, get_mod } from 'sui';

const model = (cfg) => {
    const fix = [
        {uid: "spc.check", view: SpcCheck, value: loc("l_896")},
        {uid: "spc.cfg", view: SpcCfg, value: loc("l_897")},
    ];

    return get_mod(cfg, fix, "spc");
};

const Spc = ({ mod, sideopen, cfg }) => <NavView cfg={cfg} model={model(cfg)} mod={mod} sideopen={sideopen} name="spc"/>;

const NavSpc = (props) => <NavListSub icon={<BurstModeOutlined/>} sub={model(props.cfg)} {...props} scut={15}/>;

export {NavSpc, Spc};
